{% extends 'base.html' %}

{% block content %}

<!--
<form method="post" enctype="multipart/form-data">
    <input type="file" name="file">
    <input type="submit" value="submit">
</form>
-->


<form class="form-group-lg" method="post" enctype="multipart/form-data">
 <label for="file">导入电影明细excel:</label>
<div class="container" id="upload-container">
    <div class="row">
        <div class="col-md-8 custom-file">
            <input type="file" name="file" class="form-control custom-file-input" id="custom-file-input" aria-describedby="fileHelp" >
            <label id="custom-file-label" class="custom-file-label">选择文件...</label>
            <small id="fileHelp" class="form-text text-muted">请上传不超过 5MB 的.xlsx 文件。</small>
        </div>
        <div class="col-md-4">
            <button type="submit" class="btn btn-primary" value="submit">上传</button>
        </div>
    </div>
</div>
</form>

<!--<script>
function showFilename(file){
    $("#filename_label").html(file.name);
}
</script>-->

 <script type="application/javascript">
    $('input[type="file"]').change(function(e){
        var fileName = e.target.files[0].name;
        $('.custom-file-label').html(fileName);
    });
</script>

{% endblock %}
